package com.qq.service.impl;

import com.qq.dao.UserInfoDao;
import com.qq.pojo.SysUser;
import com.qq.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserInfoServiceImpl implements UserInfoService {
    @Autowired
    private UserInfoDao userInfoDao;

    @Override
    public List<SysUser> findUserInfo() {
        List<SysUser> userInfo = userInfoDao.findUserInfo();
        return userInfo;
    }

    @Override
    public SysUser findGetByTel(String tel) {
        SysUser getByTel = userInfoDao.findGetByTel(tel);
        return getByTel;
    }

    @Override
    public boolean deleteUserInfoById(int id) {
        int i = userInfoDao.deleteUserInfoById(id);
if (i==0) {
    return false;
}else {
    return true;
}

    }

    @Override
    public SysUser findGetById(int id) {
     SysUser user =   userInfoDao.findGetById(id);
        return user;
    }

    @Override
    public int updateInfoUser(SysUser user) {
     int i=  userInfoDao.updateInfoUser(user);
        return i;
    }
}